package o;

import android.content.SharedPreferences.Editor;
import android.text.TextUtils;
import com.huawei.hwid.core.constants.HwAccountConstants;
import java.util.Map;

public class dwx extends eui {
    private static volatile dwx ˊ;
    private static final Object ॱ = new byte[0];

    public dwx(String str) {
        super(str);
    }

    public static dwx ˋ() {
        dwx o_dwx;
        synchronized (ॱ) {
            if (ˊ == null) {
                ˊ = new dwx("appActiveInfo");
            }
            o_dwx = ˊ;
        }
        return o_dwx;
    }

    public void ˎ(String str, String str2) {
        if (TextUtils.isEmpty(str)) {
            Logger.ˎ("AppActiveInfo", "can not save app active info: packageName is empty!");
            return;
        }
        Editor edit = this.ˏ.edit();
        if (str2 != null) {
            edit.putString(str, str2);
        } else {
            Logger.ˋ("AppActiveInfo", "detailId = null");
            edit.putString(str, HwAccountConstants.NULL);
        }
        edit.commit();
    }

    public void ॱ(String str) {
        if (TextUtils.isEmpty(str)) {
            Logger.ˎ("AppActiveInfo", "can not delete initParam: packageName is empty!");
        } else {
            ʼ(str);
        }
    }

    public Map<String, ?> ॱ() {
        Map<String, ?> map = null;
        try {
            map = this.ˏ.getAll();
        } catch (ClassCastException e) {
            Logger.e("AppActiveInfo", "catch a ClassCastException when getAllAppActiveInfo");
        }
        return map;
    }
}
